﻿namespace Grow.Domain.EventBus
{
    public interface IDomainEventPublisher
    {

        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="domainEvent"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task SaveAsync(IDomainEvent domainEvent, CancellationToken cancellationToken = default);


        /// <summary>
        /// 发布
        /// </summary>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task PublisherAsync(CancellationToken cancellationToken = default);

    }
}
